package mk.company.fin.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
//import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import mk.company.fin.FinConstants;

@Entity
@Table(name = FinConstants.Tables.ORGANIZATION)
public class Organization extends Model {

	private static final long serialVersionUID = -4111585097017452221L;

	// persistent
	private Long id;
	private String name;
	

	private List<OrganizationSector> organizationSectors;
	private List<Year> years;
	
	
	@Id
	@Column(name = "id_organization")
	@GeneratedValue//(strategy = GenerationType.SEQUENCE)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}

	@Column
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@OneToMany(mappedBy = "organization", orphanRemoval = false, fetch = FetchType.LAZY)
	public List<OrganizationSector> getOrganizationSectors() {
		return organizationSectors;
	}

	public void setOrganizationSectors(List<OrganizationSector> organizationSectors) {
		this.organizationSectors = organizationSectors;
	}

	@OneToMany(mappedBy = "organization", orphanRemoval = false, fetch = FetchType.LAZY)
	public List<Year> getYears() {
		return years;
	}

	public void setYears(List<Year> years) {
		this.years = years;
	}
	

}
